/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ejb.dao.usuarios;

import ejb.dao.AbstractFacade;
import java.util.HashMap;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Gomes
 */
@Stateless(mappedName = "SupervisorFacadeEJB")
public class SupervisorFacade extends AbstractFacade<Supervisor> implements SupervisorFacadeLocal {

    @PersistenceContext(unitName = "Sigef-ejbPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public SupervisorFacade() {
        super(Supervisor.class);
    }

    @Override
    public Supervisor findLogin(String login) {
        Supervisor supervisor = null;
        HashMap<String, String> par = new HashMap<>();
        par.put("n", login);
        supervisor = executeQuerySingleResult("FROM Supervisor WHERE login =:n", par);
        return supervisor;
    }
}
